package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:49
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemRoleResourceRelate implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.Id);

        mappedDaoFields.put("relateCode",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.RelateCode);

        mappedDaoFields.put("relateName",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.RelateName);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.Remarks);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.Status);

        mappedDaoFields.put("sysResourceId",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.SysResourceId);

        mappedDaoFields.put("sysRoleId",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.SysRoleId);

        mappedDaoFields.put("sysResourceTitleKey",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.SysResourceTitleKey);

        mappedDaoFields.put("sysRoleName",
            com.ourteam.system.dao.ISysRoleResourceRelateDAO.SysRoleName);
    }

    private com.ourteam.system.dao.SysRoleResourceRelate sysRoleResourceRelate;

    public SystemRoleResourceRelate() {
        super();

        this.sysRoleResourceRelate = new com.ourteam.system.dao.SysRoleResourceRelate();
    }

    public SystemRoleResourceRelate(
        com.ourteam.system.dao.SysRoleResourceRelate sysRoleResourceRelate) {
        super();

        this.sysRoleResourceRelate = sysRoleResourceRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysRoleResourceRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysRoleResourceRelate convertToSysRoleResourceRelate() {
        return this.sysRoleResourceRelate;
    }

    public com.ourteam.system.dao.SysRoleResourceRelate convertTo() {
        return this.sysRoleResourceRelate;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysRoleResourceRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysRoleResourceRelate.setId(id);
    }

    /**
     * Get relateCode
     *
     * @return String
     */
    public String getRelateCode() {
        return (String) this.sysRoleResourceRelate.getRelateCode();
    }

    /**
     * Set relateCode
     *
     * @parameter String
     */
    public void setRelateCode(String relateCode) {
        this.sysRoleResourceRelate.setRelateCode(relateCode);
    }

    /**
     * Get relateName
     *
     * @return String
     */
    public String getRelateName() {
        return (String) this.sysRoleResourceRelate.getRelateName();
    }

    /**
     * Set relateName
     *
     * @parameter String
     */
    public void setRelateName(String relateName) {
        this.sysRoleResourceRelate.setRelateName(relateName);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysRoleResourceRelate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysRoleResourceRelate.setRemarks(remarks);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysRoleResourceRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysRoleResourceRelate.setStatus(status);
    }

    /**
     * Get sysResourceId
     *
     * @return long
     */
    public long getSysResourceId() {
        return (long) this.sysRoleResourceRelate.getSysResourceId();
    }

    /**
     * Set sysResourceId
     *
     * @parameter long
     */
    public void setSysResourceId(long sysResourceId) {
        this.sysRoleResourceRelate.setSysResourceId(sysResourceId);
    }

    /**
     * Get sysRoleId
     *
     * @return long
     */
    public long getSysRoleId() {
        return (long) this.sysRoleResourceRelate.getSysRoleId();
    }

    /**
     * Set sysRoleId
     *
     * @parameter long
     */
    public void setSysRoleId(long sysRoleId) {
        this.sysRoleResourceRelate.setSysRoleId(sysRoleId);
    }

    /**
     * Get sysResourceTitleKey
     *
     * @return String
     */
    public String getSysResourceTitleKey() {
        return (String) this.sysRoleResourceRelate.getSysResourceTitleKey();
    }

    /**
     * Get sysRoleName
     *
     * @return String
     */
    public String getSysRoleName() {
        return (String) this.sysRoleResourceRelate.getSysRoleName();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemRoleResourceRelate) == false) {
            return false;
        } // end if

        SystemRoleResourceRelate other = (SystemRoleResourceRelate) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysRoleResourceRelate tempSysRoleResourceRelate = other.convertToSysRoleResourceRelate();

        if ((tempSysRoleResourceRelate == null) ||
                (this.sysRoleResourceRelate == null)) {
            isEqual = false;
        } else if ((tempSysRoleResourceRelate == this.sysRoleResourceRelate) ||
                tempSysRoleResourceRelate.equals(this.sysRoleResourceRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemRoleResourceRelate[] toArray(
        com.ourteam.system.dao.SysRoleResourceRelate[] aSysRoleResourceRelates) {
        return toArray(aSysRoleResourceRelates, null);
    }

    public static SystemRoleResourceRelate[] toArray(
        com.ourteam.system.dao.SysRoleResourceRelate[] aSysRoleResourceRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysRoleResourceRelates)) {
            return new SystemRoleResourceRelate[0];
        }

        int length = aSysRoleResourceRelates.length;

        SystemRoleResourceRelate[] beans = new SystemRoleResourceRelate[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemRoleResourceRelate(aSysRoleResourceRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aSysRoleResourceRelates[i] });
            }
        }

        return beans;
    }
}
